Skip to main content

Last Update: 2025/3/26

Gizmo OpenAI Action API

The Gizmo OpenAI Action API does not support streaming and only support > gizmo-gpt4o. It involves calling a third-party API, which may require multiple interface requests triggered by the action click event.

Endpoint

POST https://platform.llmprovider.ai/v1/action

Request Headers

HeaderValue
AuthorizationBearer YOUR_API_KEY
Content-Typeapplication/json

Request Body

The request body should be a JSON object with the following parameters:

ParameterTypeDescription
gizmo_idstringUnique identifier for the Gizmo instance.
actionstringSpecifies the action to be performed.
messagesarrayList of messages in the conversation.
parent_message_idstring(Optional) ID of the parent message in the conversation.
conversation_idstring(Optional) ID of the conversation.
streambool(Optional) Whether to enable streaming response (false by default).
modelstringThe model to use (e.g., gizmo-gpt-4o).
history_and_training_disabledbool(Optional) Whether to disable history and training data storage.

Message Structure (ChatCompletionMessage)

ParameterTypeDescription
rolestringRole of the message (user, assistant, etc.).
namestringName of the entity sending the message.
contentstringMessage text content.
attachmentsarray(Optional) List of file attachments.
partsarray(Optional) List of content parts (e.g., images).

Attachment Structure (Attachment)

ParameterTypeDescription
idstringUnique identifier of the attachment.
namestringOriginal filename.
sizeint64File size in bytes.
fileTokenSizeint(Optional) Token size for processing the file.
mimeTypestringMIME type of the file.
widthint(Optional) Image width (if applicable).
heightint(Optional) Image height (if applicable).
oss_urlstring(Optional) URL of the file stored in OSS.

Part Structure (Part)

ParameterTypeDescription
namestringName of the content part.
asset_pointerstringReference to the asset location.
size_bytesintSize of the part in bytes.
widthintImage width (if applicable).
heightintImage height (if applicable).
mimeTypestringMIME type of the part.
image_datastring(Optional) Base64-encoded image data.
oss_urlstring(Optional) URL of the asset stored in OSS.

Example Request

{
"messages": [
{
"role": "user",
"content": "1+2+3+....1000=?"
}
],
"model": "gizmo-gpt-4o",
"stream": false,
"gizmo_id": "g-HMNcP6w7d"
}

Response Body

The response body will be a JSON object containing the generated completions and other metadata.

Example Request

curl -X POST https://platform.llmprovider.ai/v1/action \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"role": "user",
"content": "1+2+3+....1000=?"
}
],
"model": "gizmo-gpt-4o",
"stream": false,
"gizmo_id": "g-HMNcP6w7d"
}'

For any questions or further assistance, please contact us at [email protected].